Order elements in data and metadata by custom order

fixes #30