Fix smart_search_prefix handling of empty search

shlex.split() returns zero-length list for empty string input. As we
need something to iterate over to return a proper dict-SQL, this broke
things and so this manually fixes that by checking the result of
shlex.split()

Part of #259
Same empty-search fix for other smart_search_*

Same fix for the other smart_search_* functions.

Part of #259
Handle search for None

Searches for None where cast into a string, so it would return the same
as a search for 'None' which is obviously not the intended effect. Now
we throw an exception instead!

This fixes #259 and #268