JavaScript resource manager