[STATUS] Major fixes to database related code

This fixes the issues I highlighted here: https://github.com/BigBrotherBot/big-brother-bot/issues/126#issuecomment-37440101