RPC: split new 'submitblock' out of 'getblocktemplate'
Cherrypick submitblock RPC function as well, and automatically sign blocks.