Implement "getchains" RPC command to monitor blockchain forks.

Port over https://github.com/chronokings/huntercoin/pull/19 from
Huntercoin:  This implements a new RPC command "getchains" that can be
used to find all currently active chain heads.  This is similar to the
-printblocktree startup option, but it can be used without restarting
just via the RPC interface on a running daemon.
That's true, but my original motivation was to include the information already here because it makes life easier.  If you want the branch, you don't have to use repeated "getblock" calls.  It doesn't hurt much to have that here instead of the length, IMHO.  But if you prefer the length, I will change it of course.