refactored theme loading to fit old config.php