ctx.writeFile now ensures dirs exist like ctx.copyFile.  Closes #30