Added implementation of entity-related memory in MemMap

Also added corresponding test cases.