change component manager to entity manager, add tests for entity manager