OmeroWeb flake8 cleanup of most severe warnings

I've started to review flake8 warnings for omeroweb and will submit changes over time to try and not interfere with other pull requests.

The changes in this PR attempt to fix the most severe flake8 warnings and should be reviewed most carefully.