Move default controller function to defaults.js

Also fixes logging 'undefined/task' in injector when default controller is used.