use global GetPathElement... function in pathlist.c
rework wgml path list processing