WIP on generating Javascript interaction code