Added exists() method to make it easier to check if a variable exists
(or is valid at least).