Improvements to DMA and SPI structures, and refactoring here and there.