Add getchains RPC command.

Implement a new "getchains" RPC command, that returns all heads of
blockchain forks known.
Add branch info to getchains.

Add additional result fields to getchains output that show the branches
connecting the heads to the main chain.
Merge pull request #19 from domob1812/rpc-get-chains

Implement getchains RPC command.