small refactor on rootScope
fix conflicts
add tests
Merge pull request #738 from matiu/bug/unitname

Bug/unitname