fixing stand alone JS beautifying, and added basic switch support