Temp Fix History, improve code order,

History update done using html5 replace method, buggy, trick with
$browser.
main js, functions on the beginning,
removed $location service,
urlParams object improved,
condition key included on the url request,