Migrated codec checkers for JSON and YAML.

Migrated the codec checkers from charmstore to be used in multiple repositories, e.g. core.
Perhaps put these in a separate file, say codec.go ?
Then more codec-related checkers could be added there if/when necessary.