Add the database functionality for votes.

authors: rbkillea