api/value: more work on function and basic-block api