fix incorrect placement of header and footer elements
put section titles into header elements
Merge pull request #30 from russkel/headerfooterfix

fix incorrect placement of header and footer elements