(a) A charitable trust may be created for the relief of poverty, the advancement of education or religion, the promotion of health, governmental or municipal purposes or other purposes the achievement of which is beneficial to the community.
(b) If the terms of a charitable trust do not indicate a particular charitable purpose or beneficiary, upon petition by the trustee or a person having a special interest in the trust, the court may select one or more charitable purposes or beneficiaries. The selection must be consistent with the grantor’s intention to the extent it can be ascertained.
(c) The grantor of a charitable trust, trustee or a person having a special interest in the trust, may maintain a proceeding to enforce the trust.
(d) This section is not intended to override the provisions of section four, article one, chapter thirty-five of this code or section two, article two of said chapter, concerning conveyances, devises, dedications, gifts or bequests to religious organizations, and to the extent there is a conflict with those sections, this section controls.