ktbs: improved Trace.iter_obsels and buitin method filter