fix($injector): allow a constructor function to return a function

This change makes `$injector.instantiate` (and thus `$provide.service`) to behave the same as native
`new` operator.
chore(docs): generate header ids for better linking

- generate ids for all headers
- collect defined anchors
- check broken links (even if the page exists, but the anchor/id does not)
docs: correct broken links

This also contains some whitespace corrections by my editor.