Refactoring plugin loading on Node.js