Functions require

Added the functions require, and fixed a bug with the user class not
correctly setting up the login flag.