Made the login function generate a token

Made the login function generate and store a token that is used to identify
the user while they are logged in.

Signed-off-by: Sebastian Lenartowicz <slenarto@uoguelph.ca>