Fixed some small bugs and finished up some early tests in Mocha.