Started core/geometry and other refactorings/cleanups