D.R.Y. for controllers.js and app.js closes #1