Better mime stripping.

Because why not.
Merge pull request #984 from Fishrock123/master

Better mime stripping.