Favor newer math.fmod over math.mod

In Lua 5.1, math.mod was renamed to math.fmod. This change will favor
math.fmod over math.mod in the num2bs function, allowing it to work
under new Lua versions while maintaining backwards compatibility.