Moved method definitions into a namespace.
Refactored mock builder and generator.