Let's add some unit tests!

Work in progress.