Section 1004 of the Uniform Trust Code is based on Chapter 215, Section 45 of the Massachusetts General Laws and ???codifies the court???s historic authority to award costs and fees, including reasonable attorneys??? fees, in judicial proceedings grounded in equity.??? See UNIF. TRUST CODE ?? 1004 cmt.