Promise.race() based select like pipeTo implementation

Also adds more test cases for pipeTo
OK. Done. But can't we just use single quotations for multiline strings?

Do you want the string contents to include \r or just code to fit 120 col? If so, we can add \ at the end of line.