Made headers and footers partials.

Handled the logic required for the page removal from dom.