[backend] refactor so that we no longer do multiple commits for key manipulations
[backend] bs_signer: refactor signing code, no functual changes