Moved IdFactory into an object for exports.