This is work in progress, it does not work yet, but
you can look at it and see a hint here and there about
ways to use msession.
