Move the dialog fragments to their own package and DRY some dialog-related code.