Modernized code, improved encapsulation, fixed some formatting AND made demo compilable

I did this basic refactoring so I can focus on improving the renderer