full implementation of requirejs