CP-5736: Unit tests

Unit tests and scripts to setup the environment. See tests/README for
details.