Fixed a bug where double keypresses were missed.
Added basic support for pasting from clipboard.

Only tested in Chrome so far.