Move main library to C89

Required detection of C89 and C99 followed by minor
source tweaks to the library and minor build tweaks
to permit C99 tests to be used.