Reorg of Python files and unit tests