finalizing optimization work
- removed an unsafe refcount optimization
- fixed many memory problems
- fixed setprop/setindex on constants