major refactor, now server can use same methods available to client for determining legal moves, etc