Added JavaScript support to queries ($where)