Add tests and docs.