Add SPI tests
Refactored spi transfer and dma packetize

separated hw_spi_transfer to hw_spi_setup and hw_spi_step,

separated spi_dma_packetize to hw_spi_dma_packetize_setup, hw_spi_dma_packetize_step, and hw_spi_dma_packetize_cleanup
Spi: make sure that txbuf and rxbuf are equal length
fixed order of rxref and txref for hw_spi_transfer
add repeat and chunk size for spi batch
chip select set in C instead of JS

fixed conditional for default callback
Fix spi batch
moved chip select from js to c
Merge pull request #41 from tessel/nl-km-spi-batch

Nl km spi batch