stop passing global funcs unnecessarily into js optimizer
optimize global id generation