devicelist.c: Code cleanup.
Initial commit for creating the folder list.