Add some basic game state and input handling. Also some refactoring.

Move frontend board logic to a Board object.