Make endpoint handling independent of interpreter -- second cut.