Fix media chooser
Changes in Wagtail 2.4 modified how the chooser dialogs function. Instead of passing around executable JavaScript, they now utilize JSON and callback handlers. The built-in chooser dialog for Wagtail media needs to be updated to comply with this change of interface.