Tidy up domain model
We bought a one year license to test hypersistence optimiser as we believe there are some performance issues in the domain model. This has found numerous issues and resulted in a number of changes to the domain model and around related classes. The work will continue but we need to get this in master.