k2 batch processing updated

Gain reference now working, new function-based batch mode.