Reorder storm.py definitions to match storm.thrift and fix flake8 issues.