Refactor dialog implement.

- Fix some style.
Server replies nice response.
Fix bug: Extract url of OAuth1.0 version (old one).
Fix bug: Never retry xhr.
Fix bug: Server replies nice response, even more.
Fix bug: Resolve url and query nicely.