All round PEP8 fixes and removed unused imports