Provide a reference to the layer
Provide layer states array in frame state
Remove layers array from frame state
Make getLayerStatesArray return an array of layer states
Merge pull request #1949 from tschaub/layer-state

Give layer state a reference to the layer.