TravisCI + CodeClimate

Also just some small refactoring.