I guess this works too, change the comments to actually reflect what the event names are though (they all start with "datamanager.") and what they're supposed to do.  Also I think you can just do $() instead of $({}).