IE Sort Order in signature keys

IE doesn't obey sort order when iterating associative arrays, causing signatures to be invalid in certain scenarios. Fixed by returning array of keys and iterating them by index.