Remove IIFE from various JS files
A port of Community Contribution !12640 (closed) from @asumaran meant to work towards resolving gitlab-org/gitlab-ce#29219
This needs to be rebased and fixed up before it can be merged, but I don't want to let this work go to waste.