Add mocking helpers for testing purposes.
Add debug handlers for mocking purposes using willSet (slow though)
Add debug flag for tests.
Add tests for testOnSubscribeMock