write out file in standalone call to js_optimizer.py
sort target labels in switches so output is consistently ordered