more thorough namespace testing

@imlucas 

more thorough testing for the namespace fields after i understood how they exactly worked from thomas
putting the namespace related code into its own function