Add initial implementation of batch encoder