Added player class and refactored main code

Wrote and implemented a player class