Add unit tests for example syntax

Tests api/examples, examples, and any embedded json in readme.
An additional option to consider is adding the kind: field to all the example JSON files; then api.Decode() should just work and you wouldn't have to use DecodeInto().