refactor($location): move repeated path normalization code into helper method (#16618)
refactor($location): move repeated path normalization code into helper method (#16618)

Closes #16618
ze-pequeno/angular.js,angular/angular.js,reneploetz/angular.js,ze-pequeno/angular.js,reneploetz/angular.js,Narretz/angular.js,mgol/angular.js,mosoft521/angular.js,mosoft521/angular.js,gkalpak/angular.js,mgol/angular.js,angular/angular.js,jbedard/angular.js,ze-pequeno/angular.js,eistrati/angular.js,mgol/angular.js,Narretz/angular.js,mosoft521/angular.js,jbedard/angular.js,mosoft521/angular.js,angular/angular.js,eistrati/angular.js,angular/angular.js,ze-pequeno/angular.js,reneploetz/angular.js,mgol/angular.js,jbedard/angular.js,gkalpak/angular.js,Narretz/angular.js,eistrati/angular.js,gkalpak/angular.js,gkalpak/angular.js,eistrati/angular.js,Narretz/angular.js,reneploetz/angular.js,jbedard/angular.js