Simplify online checking.
Call attachAttachment to simplify.
Style improvements.
Simplify error handling strategy.
Remove duplicate test.
Add test for invalid CID, improve another test.
Optimise handling of ignored parts.
Validate stderr in tests too.
Use sets where applicable.