Clean up of more global functions; more JsDruckification