Reordering Train Cars solutions

Reordering Train Cars was solved using JavaScript by 2 contestants. Solution sizes: average 2925 bytes (shortest: 1972; longest: 3435).