Resubmission of #4268 with @fat's comments (hopefully) resolved.
Allow passing data arguments to modal (fixes #531)
Implements @bronson's suggestion, all credit to him.
Add test for modal data arguments
This pull request passes (merged 2f7cf71 into e9b04ac).
Was just writing something similar myself, hope this can be merged into 2.1.1!
Guess I'll have to re-target to 2.1.1-wip then?
Re-targeted as #5261.