completed refactoring of angular code from server.js to public/js/*