Add ExpandPipe and plugged it in

* Still not able to handle self referencing patterns