bug-17927: Adding function to do most of the conversion & making the manifest of the system metadata optional.
bug-17927: Unit tests for system metedata generation
bug-18359: fixing memory leaks & bad reads in the db_layer tests