Add pep8 compliance, refactor tests into tests file, add travis and coveralls support.