Added gitignore
pep8 and stuff
Add logging and refactor.