Converted to C99 compatible code, doxygen documentation and clang compile checks