Misc code improvements

1. fixes some pep8 warnings
2. fixes some typos
3. removed six since it's actually not being used
4. other minor improvements