Fix search, add search highlighting, light refactoring