Added saving of metadata
Added test for lists in metadata