Put record writing into a function so there's less duplication, and did a bit better with Z39.50 errors.  Cleaner now.
Put record writing into a function so there's less duplication,
and did a bit better with Z39.50 errors.  Cleaner now.

wdenton/openfrbr,wdenton/openfrbr,wdenton/openfrbr