Properties of metal–water interfaces studied from first principles