Ref closing sections with indexRef function correctly

All three are now valid:
```
{{#foo:i}}{{.}}{{/foo:i}}
{{#foo:i}}{{.}}{{/foo}}
{{#foo:i}}{{.}}{{/}}
```
Throws if opening does not begin with closing:
```{{#foo}}{{/foo:i}}```