good first issue
Description
When working with maps with a large number of layers, a scripting API for expanding/collapsing GroupLayer and ObjectGroup would be very helpful.
As @bjorn suggested, this can be done by exposing the Layers and Objects views functions in the MapEditor interface.