Added injector unit tests

Injector has unit tests and better exception handling.