Fucking finally figured out how to split up php classes.
Moved useful functions to their own class.