Add documentation and improve misc.defined()
Move caret positioning into caret.js
Implement keys.on()
Fix character width calculation
Minor style changes
Implement mouse events
Don't show caret indicator when range collapsed