Added mocha tests and modified app.js as necessary to ensure that socket functions could be called for tests.