Initial commit of minimally functional library.

Everything tested so far seems to work as advertised.  The API could be
enriched considerably.