Sign in and out

This PR introduces the feature of signing in and out from the system.

Fixes #17 and fixes #22