Implement keyboard manager as a stack.

Bindings can be temporary changed and later restored.