Fix a typo.
A bit of refactoring.

Move the success and error handlers out into separate methods.
Add support for using pat-subform together with pat-modal

i.e. allowing a subform to be submitted and the resulting page to be injected
into a modal.