fix bug in apply (entering function closure) and add options to reduce code size
StablePtr/StableName primop fixes