Update examples
This MR updated most of the examples to make sure they're using up to date syntax. I also took the opportunity to enforce flake8 in the examples, so this is now part of the CI testing.
I also added an example which uses non-tensor modes, I'm happy to move this to a separate MR if people think that's better.