Add ability to do custom rewrite of JS files.

For https://webarchive.jira.com/browse/ARI-3762.