Make tests public. Rewrite most tests. Add tests.