Split out search into smaller classes.
Fixed compile errors