Refactor and Optimize... +...

This refactoring and optimization is by littlemousy:

Refactoring and optimize memory footprint. Fix broken "repeat
restrictions on region change", add "RLV_QUERY" and "RLV_RESPONSE"
messages for checking current rlv state, Add support for tracking
restrictions by script: use textString instead of key. Add StartIM
exception.
Merge pull request #257 from VirtualDisgrace/megapie

Refactor and Optimize... +...