initial commit: entity management reworked, lru cache, tests passing