Refactored monkey-patching.
Added initial test setup and trivial passing test.