Added directory tests and implementation