Added a system of EntityContexts and TreeContexts to avoid passing around references to EntitySystem