Added download of avatar
Added login, logout, register and persistent session checking