Implement sign in and sign out functions

(prototype appearance. Needs to be tweaked)