Refactor shellescape out

Also move ssh monkey patches to a more descriptive file name