Reorganization and added sphinx documentation