Changed scheduling sessions to a time based system and added some debugging facilities.