Promise.race() based select like pipeTo implementation

Also adds more test cases for pipeTo
Moved to the arrows to the same line as setTimeout