Code restructuring updates

- Use OOP for the main chunk of code. Starting the code like this will
  help us maintain good organization later. The code structure right now
  isn't completely optimal, but it seems like it's good for now.
- Some misc code clean-ups
  - Use `position.set` instead of setting each coordinate individually.
  - Use lots of helper functions to clean up the logic somewhat
  - Added a few TODO statements