Added login function

Added a function that takes a username and password string, and returns true if they
are valid (and an exception if not).

Signed-off-by: Sebastian Lenartowicz <slenarto@uoguelph.ca>
Eliminated die() in favour of exceptions

The code will now use exceptions to indicate erroneous conditions rather than PHP's
die().

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