added logout link and separate php
moved the logout button so its clickable above logs
cleaned up php, redirect if not logged in
started converting to node class, fixed redirect loop