Login/Logout functions

These two functions are useful if you want to do authentication by socket.io.  The user parameter should be the serialized form of the user (i.e. user._id or what have you).