Kernel class refactored; added cache for immutable expressions.