[Fixes #291] Ignore index braces for scope variables

So that we just check the name of the variable against `variables_in_scope`.
For example `$foo` instead of `$foo[0]` or `$foo['bar']`. It won't do
anything to empty or unclosed braces.

This fixes the two tests introduced in 3ec6651 for accessing indexes of
array and hash variables. It looks like arrays were a regression introduced
in 91fd437, but hashes may not have worked previously.