refactoring
* more simplified way to to switch config.js
* move library folder to outside