Move filesytem operations to core in order to improve portability