c++ backend: fixed `len(array)`, optimized `_ref_` lookups.