Moved 2d transformation functions to separate file.
Removed unused code.