cleaned up core.php a bit; added a log() method