fix header and footer to manage also arrays as template

Improvements on header and footer management. 
* Support Arrays as "header" (to allow a easy manual configuration too)
* header and footer can be shared between composer and manager if needed. fix #481