Moved somethings from global to anonymous namespace.

Moved somethings private in .cpp files to the anonymous namespace.