Numpy rewrite

Rewritten a lot of the code so that triangles are stored as numpy
arrays, allowing the code to be significantly more efficient. Also
corrected a problem with the rotate() function, which was not always
giving symmetrical answers – possibly due to rounding error?
Removed a bunch of junk