Encapsulated MetaData members. Added helper functions for common tasks.

As MetaData::directory_id_ is a unique_ptr, It may be better to pass the argument by rvalue and std::move it.

I agree that the attribute should be moved to Directory/File eventuall.