Adding some tests for range queries. They don't pass yet, but they don't seem to trigger the Spark-breaking bug either.