Switch from options.type to options.class in Item#hitTest(), to reflect recent change in Item#getItems().
Avoid double-insertion of root layer when importing JSON directly into it.
Allow the JS optimizer to better do its thing by creating local references to repeatedly used class variables.