Added a few basic unit tests and some documentation

you right. we'll have to document that somewhere