[WIP] Populate metadata from documents

(creating a PR so i can better give feedback)

fix #23