Added scoring system

Stores in a bank-esque transaction format which sums it up everytime you
want the total. This -can- become expensive, we don't know yet, but if
it does I'll implement a cache system.

Also fixed some other sql related issues