Address indexed, based on v0.9.1ish

Based on https://github.com/bitcoin/bitcoin/pull/2802 and https://github.com/bitcoin/bitcoin/commit/ab4bd3bdbb96e64451a38085dd42984ba444033e, see history for additional changes.