toArray with includedForeignObjects should not prefix the arrays of foreignObjects

Apply the key format in toArray also to foreignKey indices

Collections now get an root element when exported to xml, yaml, etc. for fixing naming of child elements in xml documents

Fixed csv parser