Persistent login

This implement the persitent login with a cookie.
It changes a bit how presence is handled in the server but should not impact us too much.

I tried to go straightforward and not bother too much with refactoring but I think both the worker and the server need refactoring.