Reordered function definitions to avoid warnings.

Added Makefile for working outside of the Arduino IDE.