Bugs and Optimization

* Removed unused vars
* Fixed node.require() by removing 'module' local var.
* Added function configure() for reuse.