namespaced libc functions in bg_lib to prevent collisions with emscripten
updated entrypoint definitions to compile properly with emscripten