Move non-state functions to the blackjack file and improve encapsulation