Prototype tree search functionality

A key part of this pull request is to complete a redesign of the move generation allowing the API to be used across a recursive function call boundary.