Adds getters and setters à la d3/jquery to a given object