Implemented logout functionality

Resolves #169
Closes #169