Rearranging app's logic and make available session and models in socket.io processing.