mocha unit tests, fixes #4
added optional title, fixes #5