Added database functionality and match history lookups