add type-checks to stay in sync with UnParse-js
split out anonymous functions to keep in sync with UnParse-js
continue updating to keep in sync with UnParse-js