fix code generated for IfNull
implement date_part/Extract in JS (Fixes #380)

For use in filtering.

Not all fields currently implemented (see #399).
Merge pull request #400 from mossprescott/ready/380

implement date_part/Extract in JS; fix ifNull/Coalesce