fix code style
[BUG #8185] adapt require calls to enable better dep injection during testing
[BUG #8185] add test infrastructure

* add test groups stdout, internal and external
* add first internal tests
* add empty test functions for remaining functions