Refactor some ReimbursementTypeEngine code

No behavior change.
Extract a method to make it easier for subclasses to modify behavior by overriding just the "calculate_reimbursement_type" method.
Fixes #5465