Added table creation

Fixed some minor bugs and added table creation if they don't exist already.
Found cause of duplicated key bug- pointshop trying to write all the player's data twice, pretty much at the same time.