Docs

Update some documentation; add lots of tests that I used to verify my understanding of the library.