Extra context: API + CLI

Fixes #12
Synthesizes parts of: #75, #100, #116, #161 and #199.
Thanks @fcurella, @aventurella, @emonty, @schacki, @ryanolson!
Should this be YAML? It seems that we use YAML for user-written files and JSON for files written as part of the project. As a user, I'd certainly prefer to write YAML...

(Some day, we should standardise on either YAML or JSON for all files...)