Functionality for move legality

Mostly added code to check whether or not king is in check, and if a
move is legal or not.