Add idea of SDF retrieval

 I can't quite get this to work yet.
Improve handling of constants
Add support for ordered search results