Children are returned in sorted order
fixed bug where local files were not added because of foreign key checks.  fs_obj_id now only has file system IDs. Other minor refactoring