Encode signed global id metadata with a hash.

Let's us accommodate new metadata without breaking old messages.

This change also flips some `assert_equal` calls with wrong ordered arguments.