Fix Selection type and improve D3Element API