Added getState and setState methods

- Do not use a general state anymore.
- The state is not computed automatically upon callback at the end of the
  inference loop.
- Reintroduced the depth in the meta information.
- The rule execution information now include the depth when it was executed.