rank: add context and template keyword
This makes the stored rank property accessible, to be expanded and printed.
Differential Revision: https://phab.mercurial-scm.org/D12140
To run the tests, do:cd tests/python run-tests.pySee https://mercurial-scm.org/wiki/WritingTests formore information on writing tests.