Add some optimised sort routines (sortAscending, sortDescending, qsort), and use 'safeSort' now for types that require GC referenes.  Currently, this reverts to qsort, and it will need some thought to get stable sort back