CRM-14737 - Search js - add comments and cleanup