A better approach to dereferencing

The last commit was just wrong; that recursive deref is suspicious
too.  This one is quite a big change.  It effectively changes the
interface to the core of the var implementation meaning that most
operations don't need to worry about dereferencing.  At least, that's
the idea.  It's not complete yet; I need to get rid of the dereference
in a few functions.