Some small tidying and reorganisation of unit tests.
Split Endpoint entity.