Added login and logout. closes #27 closes #10 closes #9 closes #8