Added Login/Register

Users now have to register and login to access the tools. This is just
as an extra security measure for if someone puts this on a public server
Tidy Up/Require Login

Small bits of code needed to be tidied up.
Added the login requirement to every page except "login" and "register"
pages