Make stuff work and add unit tests.