Perhaps we should move this to an utility class under `js/utilities` and the namespace window.utils.* ?

So we wont have to load in the main class, as  it's used in different places.