The purposes of this subtitle are:

(1) To ensure that a surviving spouse is reasonably provided for during the surviving spouse’s remaining lifetime; and

(2) Subject to item (1) of this section, to provide a testator flexibility in ordering the testator’s affairs.