Array query framework for javascript