Added basename function and tests
Added helper for memory allocation/deallocation and fixed getcwd implementation
Added abspath implementation
Undef basename if necessary