Revert "Revert "Remove unused window property settings""

This reverts commit 1835eaf6ec823369294059e8badf220c980cb012.
Optimize a bit setting of mappings
Minor refactoring
Curly braces code style
Do not use 'root = exports ? window' paradigm
Fix '.' command
Fix calling external editor when single line of text
Refactoring and optimization of KeyEvent.runCurrentKeys
Minor optimization in background Tab.close
Use rabs instead of manually calculating modulus
Fix KeyEvent.reset
Fix returning of Shift/Control/Alt from getKey
Refactoring and simplifications of KeyEvent.runCurrentKeys