Fixing IE key sorting

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.