first part of transition to oauth2

fixes #13: 

Implements login functionality.

@Minda: can you review/take a look?