Move header and footer code into layout

Replace production.sqlite with one from origin/master