Update main.js

While debugging, I noticed that the keysController.init() method is called multiple times.
In fact it is called when each dialog is open. my change fixes this.

You code is really nice to read, I am learning a lot, thanks for sharing.