Add logout function.
Add logout link.
Add logout link.
BROKEN. Begin major refactor.