Replace source ready flag with loading/ready/error enum

Currently sources have a "ready" boolean to indicate whether they are loading (false) or ready (true).

This PR replaces this boolean with a tri-state enum: loading/ready/error.

Note that this PR depends on #1047.