Got rid of weird window.location.pathname usages in js controllers.