Partial conversion to requirejs complete