Initial release.

Needs a test suite.

Seems to work, but beware.