Working windows version

alpha. Login logouts with partially working keepalive.
Final for some time.

Check and find bugs.
Small fixes.
Small fixes Continued.

Fixed some flags left out in previous commit.
Merge pull request #5 from prafiles/master

Working Windows Version!!