Making the bootstrap function an IIFE.
Adding preload JS as suggested.