Algebraic Treatment of the Functional Calculi of Heyting and Lewis