Moved some parameters around.
Added inverted transform function declarations.
Implemented inverse transform methods.  Increased stability by typecasting long in a few places.