Add flattened() function for flattening of Namespace instances

Calling flattened() on a Namespace instance returns a new dict with all
variables flattened to their current value (as returned by get() method).

Signed-off-by: Esben Haabendal <esben@haabendal.dk>