Login now working - significant cleanup still required!