settings in JS are now dynamic, some main.c cleanup