Allow header popup menu to be customized dynamically

Sometime the header popup menu are dynamic according to the content of
the card. This commit allows the menu to be customized after being
inflated. The menu object is passed to the listener, which can be
specified after creating the header object.