Cleanup code style/formatting
Simplify copy_fields method
Cleanup more code style issues
Add flake8 checks to tox