Remove usage of :filelib functions

This is to work around a regression in 17.1 where many
:filelib functions were broken. More information read:

http://erlang.org/pipermail/erlang-bugs/2014-June/004465.html