Refactored how the PrinceXML executable is detected.

The logic is now separated into small methods that simplify the
unit tests for this feature.