Cleanup and addition of script-location-based output filtering