Refactor DOM rendering and copy/paste support

Allow pasting into the console via a hidden clipboard. Closes #36. 
Pasting into the clipboard doesn't happen immediately in the browser's context, so we have to wait for a while to grab the text. There's no way around that.