Unit tests and docs