Add table of contents with anchor links.

Because this seems to be the cleanest, most robust way of doing it with GFM (source: http://stackoverflow.com/q/5319754/149428).