Allow layer source to be set

This adds a `setSource` method to layers and makes the `source` property observable.

Fixes #2842.