Refactor in order to support multiple handlers (only PuTTY so far, but soon OpenSSH from Cygwin or something else).