Refactored to use Phapper, way cleaner and less code.
Refactored tests for change to Phapper.
Refactored stubs..
Adding functional tests.