Implementing rev-parse's ref@{n} and @{-n} syntaxes. Added some reflags to the test repo to support unit tests.