Implemented login with username and password. As a side effect, improved the parameters handling.
Implemented keepalive mode