Made the code more C++, less C.
Implemented basic readdir and get_attr functions