Added F90 query API (compiles but untested)
F90 test for query. unfinished.