separated namespace parsing to own function, added TODOs for not working cases
added unit test for namespace normalization
fixed code for given test cases