added some testcases for MimeMessage parsing + some simple refactorings (2)

My changes from last time, this time against 'master'.

I also tried to split them into several smaller commits.
By the way: There are some TODOs in it where I found some code suspicious. It would be nice if someone could have a look at them and share his thoughts.