add number(), y_to_days, fix ymd_to_days, simplify yd_to_days

add number() and y_to_days functions. fix ymd_to_days to use yd_to_days
(previously had a JS-only problem on DST boundaries), and fix
yd_to_days to use y_to_days simpler flow.