updated D binding, adding an abstracted OO version