Support for requireJS; working version with fetching