Changed pplns calculator and payout script to use direct SQL instead of ORM for speed improvements. Fixes #22.