Changed to be Self-Referenced Event Loop

I was finding it difficult to pass around variables. Putting everything into a class is mkaing this all much more accessible.