Be E5 compatible. Fixes MP not working in Safari.

The global Number object is part of E6. This patch replaces calls by either the functions in the global object or lodash implementations.