Merge pull request #141 from shaofengshi/inverted-index

Code refactor for metadata structure change;
Continue the refactor on mete data structure change.