Added LegalMove class

Reworked part of the move search code to integrate LegalMove class.