Adding same path more than once for one namespace

Adding test for the method autoload::addDirectory and fix the case when we try to add the same path at least twice for one namespace.