Performance improvements

Made some changes to defer javascript on load for better performance