implement date_part/Extract in JS; fix ifNull/Coalesce

Might as well remove the commented-out bits.