added tests checking attachments deleting

Added:
- tests for attachment deletion
- *AttachmentFactory*
- fixed small bugs
- small import cleanup