PTY + COPY

* Added PTY
* Made a better copy function.

@lennartcl @fjakobs