lychee.Renderer: Fixes to match API docs. Performance boost for getEnvironment().