A complete rewrite to allow regular expression searching, and automated connecting/disconnecting.