Continutes refactoring. Fails 2 of 13 tests. Attachments are still broken.