VariableValue: make illegal variable access messages better

Also return an IllegalArgumentException instead of an IllegalStateException.