Change tests' docstrings to comments, because nosetests.  Also initialize global variables outside of functions, because pyflakes.  Also fix a misnamed variable reference.