Core: Use new Date.getTime(), return local reference to Date object.

Fixes #544