Merged validate functions.
Added playgame function
Added and updated unit tests.