A will, before the probate thereof, may be contested by any person interested therein, or by any person, who, if the testator had died intestate, would have been an heir or distributee of his estate, by filing in the court where it is offered for probate allegations in writing that the will was not duly executed, or of the unsoundness of mind of the testator, or of any other valid objections thereto; and thereupon an issue must be made up, under the direction of the court, between the person making the application, as plaintiff, and the person contesting the validity of the will, as defendant; and such issue must, on application of either party, be tried by a jury.