Abstract position tests from sp-show--pair-function.

Here are some abstractions suggested in issue #349. This should make the creation of helper functions easier, as well as make sp-show--pair-function a little cleaner.