Move to C99.
use inline declaration in for loops.
Added record write code.
Warning hunting.
More warning hunting.
Added rigged tests