Reintroduce realIndex for layer management

As indicated by @sbrunner we do need two indices to manage the ordering of WMTS layers.