Refactor for SmartFolders and Bookmarks

Review @ranbena or @evyatron ?