CRM-12872 - Search js fixes and improvements