Modify Pipeline Facilities to Fix PipeDream Deadlock (#3823)
* Prepare utils for adding Wait's and Record's
* Have a running PipeDream
* Add comments
* Polish comments
* Clean code
* Fix test
* Polish names
* Polish names
* Remove debug headers
* Fix a shape inference bug (not related to pipeline code)
* Fix a warning
* Address some comments
* Address comments
* Only touch consumers of outputs when re-wire edges