Reworked module loader, class and hooks