Merge branch 'maze/refactor-engine'

Well, not quite a merge. Dingo's recent refactoring made merging a hell,
so I cherry picked some changes and did a bunch of other clean ups. The
idea is clear I guess, we now provide skeleton protocol Client, Connect
and Server base classes for people to extend. Hopefully this will invite
more people to implement other (exotic) protocols :-)

Added rlogin as a proof of concept.