Build fixes

This gets us part of the way along to fixing #22. My main goal was to fix the build, we can start looking at how to make things prettier later.