Attachment order fixer & tests.

Includes test for the normal case.
Add attachment fixer test for bad created_at case
Add attachment fixer test for replaced attachments
Avoid reordering known manually ordered docs
Don't "fix" attachment ordering on new docs.