Preserve opacity and layer order on sharing

The underlying problem was that the `opacity` and `nowViewingIndex` properties were not being serialized, but I also refactored things a bit so that the different view-models class can now declare which of their properties should be serialized for sharing.