Add transactions to voting and rating

Hopefully improves the DB write performance a little bit...