Musl mathfuncs

Moves math functions from library.js to use musl 1.0.3 library functions.