Moved some $(document).on() calls down the DOM tree to their objects.
Moved last $(document).on() calls down the DOM tree to their objects.
Merge branch 'move_document_event_handlers'