Refactor out data processing from ve.dm.Document constructor

Also make collection of metadata and construction of nodes optional.

Change-Id: I02ba6d2199caccaf9fe9dcfba58eefa7b52c52b1
Merge "Refactor out data processing from ve.dm.Document constructor"