Refactoring/cleaning up

Pulled out a few functions, found some juicy, redundant blocks to kill =)

I haven't actually ran this due to lacking bs4 etc. I'm not too familiar with Python, but I think everything still works >_>

Let me know if I broke something, and I'll happily fix it! I'll work on getting it running locally.