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 :-)
I usually like to go with snake case for array keys.  Do you think you can use the same naming as the name of the json fields for these variables?  Just for consistency.