Port merged mining

This is a preliminary port of merged mining from United Scrypt Coin. The original work for this patch is done by the developers of USC and Vincent Durham.

Besides this patch, you also need p2pool or merged-mine-proxy. For example, p2pool with the test network and Litecoin as the parent:
./run_p2pool.py --net litecoin --testnet --merged http://rpc_user:rpc_password@localhost:testnet_port/

Using other parents should work but may require minor patches to p2pool. This needs some testing, I'd suggest trying to mine merged coins with several different parents on the testnet before merging this in a released client, as it'll be a fork of the coin and everyone must update.