zungmann's fixes to compile simulator on a Mac

Compiling for Mac needs some customizations noticed by zungmann in
the reprap forum, here:

http://forums.reprap.org/read.php?147,33082,279050#msg-279050

  * .bss section syntax is different
  * on_exit is not supported (but atexit is)
  * clock_gettime is not supported
deriv.awk: Calculate derivative of every column

Instead of just two columns (x and y) in the trace file, treat
every column as a function and calculate the first derivative
of it without regard for its supposed "meaning".  In addition
to getting more data from this, it also allows us to calculate
the 2nd derivative easily by running the script again on the
resulting data.

Also convert time in column 1 from microseconds to seconds.
simulator: Respect XYZE_INVERT_DIR settings

Simulator assumes a basic set of config pins.  Most it ignores
and redefines.  But the INVERT_DIR pins it did not, and these
could be useful to simulate.  So teach Simulator to respect them.
fixup: More deriv/velocity cleanup