tweaked db table names to be right
more db fixes
added logout