Adopt changes of sipa's addrindex branch

https://github.com/sipa/bitcoin/commit/fd867c7dbc1b5ad971dd308069257e7db5e11ac1:
Encapsulate CLevelDB iterators cleanly

https://github.com/sipa/bitcoin/commit/4790f3c823a33fae44b82ef7962372e38b1b0131:
Add address-based index

1) Maintain a salt to perturbate the address index (protection against
collisions).
2) Add support for address index entries in the block index, and
maintain those if -addrindex is specified. It indexes the use of every
>8-byte data push in output script or consumed script - or in case of no
such push, the entire script.
3) Add a searchrawtransactions RPC call, which can look up raw
transactions by address.