improved batch-mode operation for k2 pipeline

k2… all changed to functions