cumulative work from the last week or so- get login working, fix missing selfs, make login conditional

--HG--
branch : noink
pull in to same line

--HG--
branch : noink