Add logout function

Added button and functionality for logging out.