Fix populate task to not use static ids

Category ids are not guaranteed to start from 1. Some students have had issues with this if they have had to re-populate the db in any way. This PR uses the indexes of the list of categories instead, maintaining the order and relation between specific books and categories.