added commmand: createuser
Added login/logout via JSON api
testcase: added client_login, client_logout and fixed login() when used in a with statement