CFY-1377 flake8
CFY-1377 some cleanup
CFY-1377 fix tests
CFY-1377 add headers