A Spline Theory of Deep Networks (Extended Version)