ENH: sort the keys of a passed dict using numpy's sort function

closes #3658