Renamed Clause to Fact
Added some type annotations and cleared some warnings
Finished refactoring to allow for rules