Updated library to be linked as C and  handle char* text instead of files