Added an envelope base class. Work on removing duplication in format_as_edi methods.