Some template tweaks, added logout, some logic file fixes.