use dependency injection for configuring app
fix tests due to change on code in prev commits
Merge pull request #2 from nachinius/dependencyInjection

Dependency injection