:gift: Configuration and refactor

お元気ですか @jensechu?  I thought your project was really cool so I wanted to contribute back some changes, I hope you don't mind (feedback always welcomed).
I wrapped this in anonymous function so you can be more free with your `vars` and objects without fear of global variables.  This is also the best way that I know of to create true private methods (versus the `_methodName` approach).