started work on a cvar system, misc code fixes/tweaks