Extreme Speed Increase

Fixed the logic to rewrite the URL (with a filter) as it is being called instead of all at once when the scripts are being printed.