adding a mostly complete batch of unit tests (fixes #1)
adding inline docs (fixes #3)