Factor out ssh operations to separate module

Issue #597

Signed-off-by: Michal Čihař <michal@cihar.com>