Use macro ARDUINO to detect if we compile as Arduino library.
Seperate the VM main loop as init and loop so that it can fit into the Arduino model