First cut of allowing advanced search syntax

Refactor for backward compatibility, add test
Improve code style
Merge pull request #40 from Datacom/search_improvements_pull_request

Advanced search syntax