Cleanup and comments
Improve log messages (not finished)
Move search_text to text api
Fix pep8 issues
Add a test for search_text