Core: Use Date.now when possible and normalize calls otherwise.

Replace `new Date().getTime()` and `+new Date()` calls with single function using `Date.now` when possible.

Fixes #544