Solves issue #3

Also fixes some bugs and fix server side password handling.