Fixed bug in CoreDialog that did not remove any event handlers to dialog elements (such as elements.form.on("submit") that were left over from a previous dialog's content).