add phpunit test suites for DI build, constraints, etc. and refactor service definnitions