fix($injector): refactor module loading code and use minErr