Add application base and do things in a more C++ way overall

A lot of things to fix still, but this should be a better base to build upon.