Huge modifications in ismate and ischeck. Be sure to add ischeck test previous and post-move to legalmove.