[#74] Updated EntityManager to sort entities by depth.