runtime connection management and authentication

added runtime connection management (reconnects after disconnects) and
basic authentication support