Pass around configuration object

Instead of relying on a bunch of global data, now a configuration object is built and passed around.

Also, when running it for testing, I noticed that the processing step is a bit longer. Is this because of the dictionary added, or did my changes do this?