Make it easier to unit test applications written in the framework

Implement functionality similar to Jukito, but where the unit test environment is constructed using the same rules and behaviour as the runtime environment.