Add support for headers and footers

This project is awesome and saved me a lot of time.  One thing missing was support for layouts with headers and footers.  Here's what I changed to support my app.