Chess Moves in Javascript