Replace doc code

In the ReStructuredText (*.txt) files, many of the copies of Python code were out of date. Replaced copies of Python code with links to sections of the corresponding files. This dramatically reduced the number of lines of code to maintain. This will help keep documentation in sync with code (but will not guarantee synchronization). Renamed two ReStructuredText files to match corresponding Python files. Modified code files for improved readability. Modified .gitignore to ignore tmp directories.
If `=` is used for keyword assignment in a function call, there should be no spaces around it (PEP8).
I know we do not always respect pep8 in the tutorials, but if we are cleaning things up, it would be better not to add new violations.