Reorganization complete

put functions into routes folder to make app.js more readable.