Moves "entity" functionality into a separate module.