Add basic copy support

Adds basic support for copying out of the terminal.
Should fix #11 and #48.