Implement Pkg.update hook

If your package contains a `deps/update.jl` file, it will now be executed
on Pkg.update().
Add unique(AbstractArray, dim)

Efficiently finds the unique columns, rows, etc. of an array. The
algorithm first hashes each row, then finds the unique hashes, and
finally checks that the hashes don't collide. It is roughly O(n) in
the number of elements in the matrix.

This is my first time using Cartesian. Without it, this code is
presently about 10% faster for finding unique rows of a matrix, but
the overhead is probably worth it for the generality.
unique(AbstractArray, dim): incorporate @timholy's suggestions
add an internal function to replace Main, use it in sysimg.jl

make the Core.Main binding non-constant, so uses of "Main" in general
refer to the *current* Main. Doing "import Main" will give you a
constant reference to the Main at that time.

fixes #5802

related to #1195
Issue #5455 : Added 1-norm, Inf-norm and Frobenius norm for SparseMatrixCSC
Merge pull request #5811 from JuliaLang/sjk/uniquedim

Add unique(AbstractArray, dim)
Merge pull request #5822 from lruthotto/master

Issue #5455 : Added 1-norm, Inf-norm and Frobenius norm for SparseMatrixCSC
Merge pull request #5783 from JuliaLang/kf/updatehook

Implement Pkg.update hook
Ignore errors when removing doc .git files, as we might not have any (e.g. building from a tarball)
make isempty(itr) work for general iterables (as mentioned in #5797)
fix missing gc root in ifelse(). fixes #5813
Merge pull request #5821 from JuliaLang/jb/replace_main

add an internal function to replace Main, use it in sysimg.jl
Merge pull request #5827 from stevengj/isempty

RFC: make isempty(itr) work for general iterables
NEWS for #5827