Clean up the code.

* Remove repeated code
* Add new variables for setting up GNU screen session names, ssh hosts etc.
* Add support for tramp on remote terminals