Added derivation depths. This fixes some problems with retraction when cyclic facts are derived.
Read static priority flag from byte code.
Merge for retraction