[PATCH V2] Implement modf math builtin

V2: use the reference implementation as suggested by Matt Arsenault