added tests with mocha. see #17