BackTransform should not put empty names in the productions

this made parsing the merged grammar impossible
more asserts checking for empty strings
use functional list instead of imperative Stack for worklist