Fix cross-domain handling of 404 for the Map entity search. Added some modals and code cleanup for Map page