Sort repository list case insensitive

Sort repository list case insensitive.

Also use the more appropriate ksort function as we do not want to sort by array value but by array key.