Javascript resource loader