Moved transform functions into Transformers; added tests

Transform functions moved into Transformers object with all references
to non function local scope removed. Added simple tests to all transform
functions.