PEP8
Use the print function in docstrings and doctests
Remove outdated examples
Update check_examples.sh
Use the print function in examples
PEP8 (examples)
Better check of file open mode. Closes gh-318