Improve docs, unit tests