added listdir() support and added tests