Add Ranked Match and Fix Database Bugs

Close #6