Clean up some code
Expose main config and add event emitter for others to take advantage of adding custom configurations