Refactoring of app.js, making the configuration work as well as socketio stuff.