Add more deterministic sorting and storage (ordered set) in order to
generate wrappers that are cache friendly.  Also fix an issue with
passing parallel job count in to compile() when recompiling.