move errors to separate file, add spawn and open_ssh methods
some fixes