Refactored main loop and attempted to clean up

Created a few functions to handle specific things like scanning the post
text and creating scores. This should hopefully make the project more
manageable for future plans.