Automated one-loop calculations in four and D dimensions