Fix relative path URL bugs in the plugin API.

Fixes plugin-related 404 URLs, as well as the plugin directory URL
for installations which use a relative path.