PEP8 changes and code organization

Also added gitignore.