Fix some random CS issues.
Reduce code duplication in DI extensions
Fix broken specs
Merge pull request #436 from stloyd/bugfix/cs

[WIP] Fix some random CS issues.