ringfs.c: reorder functions to match header
add ringfs_count_estimate() + tests