Allow files to be compiled in C mode under the emulator

Adds definitions for memcpy and memset
Fix proper compilation of SPI the library

Now compiles the SPI library properly.

STM32F4discovery compiles but will not work,
due to a number of places not implemented yet.
These are marked with #warning