Added database functionality and donation count

Note: the payout timeout function will be updated later