fixes for 'scatter', plus 'gather' wibbles

This did not check that the index mapping and input vectors were the same length. Fix this by taking the intersection of those.

Fixes AccelerateHS/accelerate#185