[#2373] Enforce unique ID across whole environment.

Problem
======

We want the unique ID to be unique across any code... right now it is unique only inside the same factory.

Changes
=======

make unique id a singleton.
update to support Ubuntu 14.04
wrote an automated test.

How to test
=========

reviewers: @alibotean 

check that change make sense.

thanks!