Extra context: API + CLI

Fixes #12
Synthesizes parts of: #75, #100, #116, #161 and #199.
Thanks @fcurella, @aventurella, @emonty, @schacki, @ryanolson!
Please leave the encoding explicit here, as a reminder, as it will need consideration when doing the encoding patch. The first consideration will be what encodings are allowed by the YAML format itself - see http://www.yaml.org/spec/1.2/spec.html#id2771184