(#17094) Ensure that a leading $ resolves

The issue was the we could end up in a recursive, infinite loop if the
variable was preceeded by a `$`. This was caused by an old parsing
mechanism that dumbly stripped off characters and sometimes made no
progress. The new system doesn't do that, but this ensures that it
doesn't.
Merge pull request #146 from zaphod42/issue/master/17094-infinite-recursion-on-lookup

(#17094) Ensure that a leading $ resolves