Jamie Masson has agreed fresh terms at Aberdeen, with the midfielder penning a new two-year contract.