Reference iteration, take 3

Hopefully correct this time:
- iterating with globs assumes the glob is a full name, e.g. 'refs/heads/test-*' or 'H*'
- iterating without a glob uses a default glob of 'refs/*'