Minor reorganization. Bit of linting. Fixed exporting.