Reworking the ui.dialog interface.

Specify the type via options.
Clean up the dialog code.
Extract and expose Facebook signup click method.