Add a way to set custom headers for the AJAX request.

This change is backwards compatable with the original code, and is
especially helpful for setting Authorization headers for OAuth services.