Add json validation tests

This commit adds JSON structure validation tests to ensure that the
output is backward compatible with older versions if we enhance it
in the future.

Partly fixes gh-21