finished documenting rete-beta-part + minor refactoring