Implemented the tracking of the metadata updates.

Switched from Vector to SortedVector. Removed dead sorting code.
Added a type to represent MetadataType.

Minor fixes missed in the previous CL.
2 files changed