RF: reorganize files, new subdir lib/