Allow different controller formats

This change allows for the controller of the dialog to be specified inline similar to how this can be done when defining a new directive.
This change is actually not related to the feature being added, but I had already changed this and it snuck up on me. In essence it's the same change as the one from a while back where the ngDialog.opened event would be called too soon.