Added some C++ wizardry regarding classes, public/private members, polymorphism in constructors, and inlined/outside functions