fixed all PEP8 and pyflakes errors, removes extra lines of code

Installed PEP8 and some test files, can you guys install PEP8 and pyflakes in your virtual env, and update the requirement.txt , because I don't have a virtual environment.