Nl km spi batch

Reimplemented spi batch so that its memory safe. 

Reviewed By: @jiahuang @tcr @kevinmehall @johnnyman727