Add unit tests.
Merge pull request #2 from josephj/master

Please use my unit test.