Sessions control with functions

functions.php now contains the old login.php and logout.php and
session.php now uses them instead of odd seperate files.