Simplify constant handling

Revert last constant handling, it has too much overhead. Using constant
getter function to push value if the constant is function, otherwise
just put the value.