Added a bunch of functionality for 3d and 2d rotations. some nice refactoring.