A Generalized Commitment Machine for 2CL Protocols and Its Implementation