Add tests for the between_two_tags() util function

(Currently some of these tests fail)
Get rid of redundant index argument in between_two_tags()
Reimplement between_two_tags()

All tests now pass.