Reworking character var lookups in the formula parser

This isn't completely done, but it's the first step into
making this aspect of the parser a bit more robust. This is
necessary for the next step of setting up secondary character
stats.