User map

So these commit contains now all the bugfixes mentioned from you in the previous closed PR.

I suggest to read also the comments in the source code.

Please comment on things which bothers you :-)
Actually I think i have my head wrapped around the code a little better now.  I think I'll be okay without the staging deploy.