Added search.html.erb and search methods; general refactoring