Reimplement jsonb_typeof using the jsonb API.

And put it in jsonb.c where is belongs.
Fix error handling
clean up headers
Reimplement jsonb_object_keys using jsonb API.