Fix handling of unicode surrogate pairs

Also, binary match context optimizations revealed by `bin_opt_info`.