Fix a bunch of bugs in $.ajax

Do not set the content type unless a form has been submitted.

allow $.ajax(url) to work (for promise/a+ calls)

Fix bug with response headers always being text/html b/c of contentType always being set.