Add ConstantFunction instead of ParsedFunction when possible

closes #2935