A lot of refactoring of Panels and Search. close #214. close #216. close #217.