fix($location): fix handling of hash fragment links

This commit adds a new `fixHashFragmentLinks` method to `$locationProvider`. This method fixes incorrect rewriting of hash fragment links. In order to use in your project, you need to enable the new behavior:

```js
myApp.config(function($locationProvider) {
  $locationProvider.fixHashFragmentLinks(true);
});
```

In addition, you need to inject the `$anchorScroll` service to one of your controllers/services, to enable automatic anchor scrolling.

Closes #8675