Better ajax response handling in dialogs.

- Unauthorized requests now returns a 403 status.
- If the request returns javascript the dialog body gets emptied.
- Only html responses are placed into the dom.