Added test for first move generation.

Also fixed some bugs