jsPlumb: create endpoint per port_no.
javascript: code cleanup