Add qunit and some tests for #12