Versatile electrical stimulator for providing cardiac-like electrical impulses in vitro