Restructuring the math library around the tensor protocol. Many more changes to
come.