New betting system

Rewrote betting system.