Extend TreeNodeLoading plugin for WMTS

This commit extends the TreeNodeLoading plugin to make it work with group nodes that do not have OpenLayers layers directly attached to them. This is necessary for groups of WMTS layers.
Register loadstart/end listeners on WMTS layers

When the WMTS GetCapabilities response is received we call registerLoadListeners on the TreeNodeLoading plugin to register loadstart and loadend listeners for the new WMTS layer.
One WMTS GetCaps request per WMTS URL
LayerTree code styling
No need to test isChecked on loadstart

When a layer triggers loadstart we need to add the loading spinner, the checked/unchecked state of the node need not be looked at.
Simplify layer index management in layer tree
Reintroduce realIndex for layer management

As indicated by @sbrunner we do need two indices to manage the ordering of WMTS layers.
Better var names and comments in LayerTree
Clear the wmtsInfo object when loading a theme
Do not fail when removing groups

Removing groups while WMTS capabilities are loading fails because the group's allOlLayers array includes null items.
Cache WMTS Capabilities format in the instance
Merge pull request #398 from elemoine/wmts

LayerTree WMTS improvements