Transform functions put into appropriate object, proper transforms form dim <= 3, and comments/docstrings changed