Added js object query
Refactored indexes, query to rationalise code
Refactoring in preparation for case-insensitive string searches
Changed 'filter' to 'match' for consistency with db syntax