Don't always set const_item for return value, as return is not independent
of inputs.

If input is constant, only parse once and return cached value for
subsequent calls.

Properly return is_null, not error, if determined after init.

Add compile option for debug output.