Fixed memory reallocation bug

Fixed an error wherein moving states stored in Rule::myChildStates due
to container expansion would cause pointers to become invalid in the
middle of a long call tree, resulting in calls being made to objects
that had been moved.
States now keep a pointer reference to their parent rule instead of just
an ID.