Fuzzy matching in javascript