Fix GitHub source links for API

In 746b404, a line was added to `doc/source/api.js` to remove `lib/` from the sidebar link; however, this causes the sidebar links not to work any more.

I also changed `/tree` to `/blob` while I was at it, since that seems to be the new path format.

I suspect there was another reason for the initial change, so hopefully @aheckmann can tell me if this fix breaks something else. :)