Renames the functions to match the C versions

There is an underscore in the function names in my version, but not in
the javascript original