First round of metadata tests and some bug fixes

Implementation for all the MRU tests are done. Object metadata tests are left (in the next pull request).