Refactored SshTask.

I need to make some project-specific custom SSH tasks that would benefit greatly from a refactored SshTask.

As you can see I have merely split main() into three parts.