Issue #2642156 by Sam152: Move the logic contained within hook_page_attachments to an AttachmentManager service