Revert "Remove metadata/id from the representation"

This reverts commit 786bbd63768d316c8633bdfb60bfaee2808210a0, and
converts the metadata/id representation to a Long.
Merge pull request #3167 from cleishm/node_metadata

[2.1] Revert "Remove metadata/id from the representation"