Transform code to OOP style

Hello, I've attempted to fix issue #10 here, to transform the code into OOP style. The tests pass, so I hope it's okay.
Once this is done the attributes and other functions except `run()` can be indicated as "private" by prefixing them with an underscore.