js: robot-name: pull generate_name() out of constructor

and rename internal name picker
js: binary: use reduce to add powers of two