fix(stateDirectives): Generate the proper URL when the state changes

As of now, the generated URL changes if and only if its parameters do. So something
like `ui-sref="{{myState}}({id: myId})"` would simply work for the first time. When
`$scope.myState` changes and `$scope.myId` stays the same, the URL is not regenerated.
This commit fixes this by observing the attribute and regenerating the URL if it changes.
I have also added a test to make sure everything works.
This commit may also be also be relevant for #371, as it allows for empty state values (`""`)
to be processed and set into the `href` attribute. We could bind this parameter to a
directive attribute so the user can decide wether to accept this behavior or not.