Changes to user_categories_for_books as discussed in  ...

...messages on the previous pull request, plusfixing a problem in the formatter function where duplicates could be generated.