More most three initialization code to three-init.js.
Refactor keyboard events.