Refactor ContentView.path and related code

Reduce the amount of duplicate code used to implement method `ContentView.path`.
Make the relevant tests easier to read, and alphabetically sort the relevant
test's data.