JavaScript class for on-line approximate string matching (for use with auto-complete)