Improved tests, added a build.ninja for TeamCity, and fixed formatting again to work with Rapptz's style.