Full AJAX support

Now supports correctly formed AJAX requests. Responses still pending.