Create chess.cpp

Some common chess functions needed for engine