add Login support

added support for login to the server using text username and md5 of password.
also updated some places for better cross-platform.