Added travis-ci config and fixed code to get everything working