Move xf:output handlers to Scala
Fix #852 "`xf:output` generates a `label` with a `for` pointing to a `span`"
Minor: just use match