Added documentation for dependency injection and cleaned up code examples