Stratum target refactoring

This keeps difficulties using pdiff and target internally, more consistently, and makes explicit various stratum bug workarounds while improving support for compliant stratum servers at the same time.