Refs #4116, move initElements code to utility function in UIControl.
Refs #3089, only show map in visitor profile if map is not showing on another part of the screen, load the map through AJAX, and some tweaks to code style.