Improved API for use of psshlib as library.

Allows more complete control over what psshlib does,
and exposes a simple programmatic API.