Refactored modal to use event triggering rather than a data-set callback

AFDP-74 - modified modal onLoaded event handling to use events, rather than a single defined function in the data attribute.