Added some tests before refactoring

Always a good idea to do this, to verify that the new code is bug-compatible
with the old.

These tests were taken directly from the README.