make the js implementation pass some tests and parse some stuff