Encapsulated MetaData members. Added helper functions for common tasks.

Replaced all `NULL` with `nullptr` in this file.