Rearrange the PATH to respect the order defined in /etc/paths (#927) and
to prepend it to $PATH instead of appending it (#950)
Fix to respect the order of paths in /etc/paths (oops)
add -O and -G to test command

they are available on Linux and OS X, and now ported to fish
use wstat in test command to follow symbolic link
fixed fish-shell/fish-shell#944

When the completion list includes the exact typed string with other
candidates, i.e. completion_t.match.type == fuzzy_match_exact,
the other candidates will be removed from the list, as they are not
the "best type". This is inconvenient for the user who wants to
type and complete commands in the other candidates.

The commit is to make the best_type to fuzzy_match_prefix as highest
priority, also, when comparing to best_type, the same or higher
priority completions can both match.
improve comments and extract a common function
Clean up some comments and make a function static
Merge remote-tracking branch 'upstream/master'