Refactored piece and king capture to own functions.
Refactored duplicate code for detecting captures.