Configured grunt to use mocha.
Added unit test logic.
Modified how I'm exporting the function for clarity, and fixed a bug to do with bracketsi n the wrong places.