Change the way main.js works, add hook to required object
Change the way modules are accessed
Improve module handling