Lands may be conveyed within the limits fixed by law, so as to avoid perpetuities, and subject to such other restrictions as are imposed by this Code for such terms as the owner thinks proper; and courts are enjoined to give effect in such cases to the intention and meaning of the parties.