Promise.race() based select like pipeTo implementation

Also adds more test cases for pipeTo
Heh, this is a good example of #139