Add unittests fro model. Simplify ns management