I added unit tests so that we can quickly tell if new changes break anything.