mw.util.$content from module mediawiki.util seems to be needless.
$( function () { mw.util.$content... } );
can be replaced by
mw.hook( 'wikipage.content' ).add( function ( $content ) { $content... } );
mw.hook() is necessary to support Live Preview.