Added auto-login support, added feature detection, added logout
New and updated, working for new apiserver version