migrate to RequireJS modules