Simple O(n^2) algorithm in Python for closure of Functional Dependencies in Relational Database Design