Minor refactorings, and search controller, refs #8.