Scripts are now only loaded when needed

-Only the needed scripts for the certain view are loaded instead of all
of them.