Made headers and footers partials.

Handled the logic required for the page removal from dom.
Moved the close function to the baseView class.