Hearts beat Dundee to continue impressive season