Added some unit tests and fleshed out the API a bit.