Fetch structural metadata from the database

Per #247.
Update comment style
Fix double-escaping of structural metadata

This was being inserted into the database with quotation marks intact,
making the data impossible to unserialize.