the great rewrite

drop the jsapi history, and make user responsible for memory
management of values they create