(maint) Add --trace option for low-level logging

Targets logging that may be useful in debugging, but rarely, and occurs frequently enough that
it clutters the output.
(CFACT-121) Check that a sub_match is valid before using lexical_cast

This is required to handle optional arguments without throwing an exception.
Fixes matching short libruby names like libruby20.dll or libruby.dylib after
changing to use int for version comparison.