Add docstrings and doctests to table.py + Python cleanups.