Refactored header code

Unified code for whether logged in or not
Added search bar