Improved tests and documentation.
(closes #24, closes #17)