Refactor Player class, add tests for it