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.