Moved match_next_value and set_value_for_tag to common option.
Refined convert code. Incomplete.