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 :-)
We need to add longitude and latitude to the JSON. That's why we have to encode the php array to a JSON string. Otherwise it won't work.