Issue #191 - More refactoring from app.js to use controllers instead of db directly