some more cleanup for functions.php; moved a method from functions.php to captcha.php (only used there); fix for Directory helper