Support yaml context files

Related to #249

I tried to use #269 but it's diverged quite a bit from master. I resolved the conflicts and started trying to get it working again, but it ended up being a lot more work than just starting from scratch.

This was the smallest change I found that allowed me to read yaml context files, and still maintain backwards compatibility with the json files.

Feedback welcome.