Refactored how key bindings work.

Previously, key bindings were rolled out - now, they are indexed by tables.