Reorganized so that you could reasonably call this a Python module now.