Unless the action is commenced within three years, a person may not bring an action upon a contract or liability, express or implied, except as provided in AS 09.10.040, or as otherwise provided by law, or, except if the provisions of this section are waived by contract.