General purpose loading utilities for JavaScript