Reorganized everything for switch to python.