Add order clause support to InfluxHandler

Also, fixed an NPE when where clause is not defined