Simple recursive function that takes 2 arrays and sorts the contents of the first according to the contents of the second.