I think it would make more sense to just include modules into .xpi and then map to the an URI in it rather than copy files one by one every time.