Added most of the write function for SPI flash, including all of the logic for reading in 4K blocks, copying bytes over, and then re-writing the block. Fixed function declaration for SPI write function (had const, which it shouldn't).