Impelemented user logout button and use permissions. Fixes #47.