bug fixes.
code cleanup.
added support for automatically starting/stopping the relay server without a connect/reconnect extra step.