Unit test fixup

I've redone the tests in Mocha with Supertest as a harness for Express. I think I've addressed a couple of problems that the tests had. I hope this may be of some benefit.