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 :-)
Are you using this to determine whether it's on the profile editing page?  I think there's a way to extend templates with twig that would make it easier to do this.