cleanup of blockchain-wallet code, functions should be assigned on prototype, and fix accidental global