Refactor common component functionality to component.js

* Writing well-behaved controllers is easier 
* Reduces log(component_name, ...) noise