Wait for copy to finish before proceeding

`pipe()` is asynchronous, so use promises that resolve when the copies finish. I believe this will fix #6.