Clean up notification contexts and goroutines after ws disconnect.
Clean up notification contexts and goroutines after ws disconnect.

This refactors the wallet notification code to reverse the order of
how notification contexts are stored.  Before, watched addresses and
outpoints were used as keys, with a special reply channel as the
value.  This channel was read from and replies were marshalled and
sent to the main wallet notification chan, but the goroutine handling
this marshalling never exited because the reply channel was never
closed (and couldn't have been, because there was no way to tell it
was handling notifications for any particular wallet).

Notification contexts are now primarily mapped by wallet notification
channels, and code to send the notifications send directly to the
wallet channel, with the previous goroutine reading the reply chan
properly closing.

The RPC code is also refactored with this change as well, to separate
it more from websocket code.  Websocket JSON extensions are no longer
available to RPC clients.

While here, unbreak RPC.  Previously, replies were never sent back.
This broke when I merged in my websocket code, as sends for the reply
channel in jsonRead blocked before a reader for the channel was
opened.  A 3 liner could have fixed this, but doing a proper fix
(changing jsonRead so it did not use the reply channel as it is
unneeded for the standard RPC API) is preferred.

dajohi/btcd,Dirbaio/btcd,Stash-Crypto/btcd,adiabat/btcd,davecgh/btcd,Evil-Coin/Evil,ltcsuite/ltcd,Dirbaio/btcd,btcsuitereleases/btcd,hectorj/btcd,qchain/btcd,FactomProject/btcd,DanielKrawisz/btcd,glv2/ppcd,runeaune/btcd,aakselrod/btcd,btcsuitereleases/btcd,cqswxj2013/btcd,tb00/btcd,cjepson/btcd,sysbot/btcd,pkothbauer/btcd,dan-da/btcd,Evil-Coin/Evil,aakselrod/btcd,ppcsuite/ppcd,BitGo/prova,dajohi/btcd,btcsuite/btcd,jcmincke/dcrd,danoctavian/btcd,DanielKrawisz/btcd,wallclockbuilder/btcd,dajohi/btcd,BitGo/prova,jongillham/btcd,FactomProject/btcd,cjepson/btcd,btcsuite/btcd,jimmysong/btcd,wallclockbuilder/btcd,danoctavian/btcd,jrick/dcrd,stevenroose/btcd,toddfries/btcd,Cleawing/btcd,runeaune/btcd,CryptocurrencyCabal/htcd,stevenroose/btcd,pkothbauer/btcd,cqswxj2013/btcd,decred/dcrd,toddfries/btcd,jrick/btcd,hectorj/btcd,jcmincke/dcrd,qchain/btcd,soapboxsys/ombfullnode,soapboxsys/ombfullnode,1d4Nf6/btcd,jrick/btcd,Cleawing/btcd,adiabat/btcd,ppcsuite/ppcd-old,1d4Nf6/btcd,ltcsuite/ltcd,CryptocurrencyCabal/htcd,Roasbeef/btcd,tb00/btcd,jrick/btcd,glv2/ppcd,ppcsuite/ppcd-old,decred/dcrd,jcmincke/dcrd,mathiasrw/btcd,Dirbaio/btcd,davecgh/btcd,ppcsuite/ppcd,Roasbeef/btcd,sysbot/btcd,Stash-Crypto/btcd,dan-da/btcd,jrick/dcrd,jongillham/btcd,jimmysong/btcd,mathiasrw/btcd