add support for an Electrum extract script

also small improvement to Electrum performance