do login and logout from inside angular. Closes #23