Improve search functions.
Fix interface and add a little bit of documentation.