Rely on more Python and less on mako, setup a small shared common mako file in config/plugins/interactive_environments/common/ie.mako. Move ie.js into client/galaxy/scripts/galaxy.interactive_environments.js and extract IPython's require config out so it doesn't have to directly reference client/galaxy/scripts/galaxy.interactive_environments.js (I doubt it is where that file actually should be).
Pragmatically this allows visualizations to be enabled by default but not IPython stuff and provides a spot to put a warning about security issues. More abstractly I think it provides a nice separation (initially though superficial) between these plugin types.