adds connect/2 and refactors add_user to do the check for duplicate usernames