Reorganize code to function nicely as hierarchically structured python package.