Moved module header block into head
Added capture and config code to the header template