Refactoring recentprojects controller, service, directive, and view. Karma testing controller