Add DI tests
Merge pull request #302 from stloyd/feature/di_test

Add DI tests & fix some issues