In order to expand strings of the form "~/path/to/hooks" into something
like "/home/ttaylorr/path/to/hooks", let's introduce the
tools.ExpandPath() function to do just that.
tools.ExpandPath() inspects the first character of the given string to
see if it begins with a "~" (indicating the presence of a home
directory.
If there is, see also if it refers to a specific "~user", and expand
appropriately.
To ensure that we can run the tests in tools/filetool_test.go in a
platform-independent manner, let's ensure that the results are
_semantically_ equal by first passing them through filepath.ToSlash().
We'll use this in the following commit in order to perform path
expansion on the value of core.hooksPath.