Also cleaned up label escaping and consolidated the test suite regarding label_tag. Backport of ab686022f from master.
SCRIPT_NAME
FORCE_SCRIPT_NAME