Support for year queries with ranges

The implementation of ranges is simplistic, no BETWEEN or < and >, just IN with explicitly expanded years.