Removing unused variable from index.php
Using str.replace with regex instead of flags

.replace('x', 'y', 'g') does not work in Chrome or IE if we want to
replace all instances of x, so we have to use a regex:
.replace(/x/g, 'y')