Give layer state a reference to the layer

Where we use `ol.layer.LayerState`, we also need a reference to the layer.  This is currently handled by creating a [couple](https://github.com/openlayers/ol3/blob/6a3d34940936ecf55ee450e4cf5dfd73fa55d311/externs/oli.js#L67-L68) [different](https://github.com/openlayers/ol3/blob/6a3d34940936ecf55ee450e4cf5dfd73fa55d311/externs/oli.js#L71-L72) structures that are passed around on the frame state.

An alternative is to give the layer state a reference to the layer itself.  With this change, the `getLayerStatesArray` returns `Array.<ol.layer.LayerState>` (instead of [the current structure](https://github.com/openlayers/ol3/blob/6a3d34940936ecf55ee450e4cf5dfd73fa55d311/src/ol/layer/layerbase.js#L150-L160) containing two arrays).

The frame state is given a list of layer states instead of a list of layers.  It should also be possible to remove the lookup of layer id -> layer state on the frame state, but this is currently used when the removal of unused renderers [is scheduled](https://github.com/openlayers/ol3/blob/0de380c7d29d228d51a21a6f8e7d8146ec774ffb/src/ol/renderer/maprenderer.js#L214-L228).