Refactor the `tip.parser-test` namespace

There was a lot of duplicated code, which wasn't very pretty and violated the DRY principle. The addition of a few helper functions has greatly cleaned up the namespace.

Accepting this pull request closes #4.