Unit tests and CI

Since this was at its core a legacy project, we're lacking unit tests. Let's fix that, and as an added bonus get Travis working too.