Change some loops to arrays rather than objects (fixes keys with modifiers)

This commit seems to have been missed in #1260 when continuing from #1177. Without it, keys with modifiers don't work (since using `for ... in` includes the `rotate` method for array methods). Try `<a-f>` in the default bindings for an example.

Related to this, we should really be using `for own ... in` instead of `for ... in`, since we never (so far) have wanted to traverse an object's prototype while trying to access its members.