Factor out almost all fs. and path. calls in the tool

This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.
These two lines fail silently because strings are immutable. You need to do `p = p[1] + '/' + p.slice(2)` instead, I believe.