Reorganise SPI to a separate library
Further reorganise SPI and compilation.  Sigh, a too large change.