Use print_extra_script because print_scripts_l10n has been depricated
Almost a complete rewrite to merge the functionality of minit logic.