Commerce Bank is in the midst of a legal battle after a software company threatened to abruptly cancel its treasury management services and leave the bank’s customers hanging.