ORION-407 Add sorting to metadata template attribute definitions