WIP-- Compiling, not yet tested/functional -- WIP

Changes required to iron out compiler errors, warnings, etc.  Code now
compiles with clang or gcc.
WIP: Fix minor C89 issue