Move some attachment-related prototypes and structures into attach.h from the global headers. A small step towards sane dependency tracking and code cleanliness.