Implement ioc

Make tests actual unit tests
Introduce mocking and ioc