Global var refactor

Fixes https://github.com/rhiever/reddit-analysis/issues/23