Improved path substitution

Rjs path substitution is now only performed where the user declares a path in their main configuration. This should be more reliable in general, and faster given that we're now only mutating the main configuration in the build writer.