Add a few comments and make whitespace more consistent.

I realise 2 spaces is common in JS-land but I started using 4 so I win
for now ;).
Make url construction sensitive to $locationProvider configuration.

$locationProvider can be configured for HTML5 mode (no #fragment needed)
as well as including a custom hash prefix (#! is common).