Added Travis config file with CodeClimate. Refactored more code out into own methods.