Further changes to fix some issues over property indexes.

Bugs in query and range building for ES. Remove some defunct special cases and fix the mapping.