Replace glob and path.join with faster alternatives

This cuts rebuild time in half on my sample set (1000 files).
Use encoding option to readFileSync/writeFileSync