getVar will throw an exception on unfound variable, unless $default is set which will be returned instead.