rewrote assembleMetadataFile

added writeArray and readArray
added tests for those fns
added readFile fn