use common:options_to_js and add more tests