Tightening up isValidMove.

Closes #21. Fixes #17.