Re-arrange RuleEngine code into reasoning subdirectory (from #822)

Please review.