Implemented Root.consolidate

Also updated the import/export functions accordingly.