CSPACE-6239: Significant refactoring to make better use of object inheritance and macros, in conformance with DRY principles and to simplify most objects.