Changes State#getByPath to use environment type look-up instead of class look-up for performance.