Background worker for fetching entities from DB

Doesn't report progress yet, hoping phil might do this because it seems
complicated, but yeah the background worker performs the database
reading and inserting into the ratingslookup table.