join a room when clicked

Only works for passwordless rooms at the moment. Will make it work for passworded rooms lata. Tried to make the code cleaner and more modular. Don't think I succeeded. Open to ideas.