Split javascript initialization code into initializers.