[v4.3] Memory optimization, support two instances and other minor improvements.
- Memory optimization: usage is down to 4.3KB
- Memory usage reduced from 16KB to 4.3KB from version 3.9 -> 4.3
- Support for two concurrent script instances in same device
- Other minor improvements.