Generic Namespace Function.

From 'JavaScript Patterns' (O'Reilly) by Stoyan Stefanov.