Both features are already there, but you have to hit the gold mine right.
you see an arrow where the unit is going. If that arrow is green the unit is just walking, but if the arrow is yellow it is going to harvest.
for the attack, on right click currently is the walk command, which is meant to ignore enemys.
But if you click on the attack button beforehand, it will fight along the way to the location.