Added unit tests for BODY and ENVELOPE parsers, fixed bugs