First version of a search interface.
Some more cleanup.