remove tsort()
remove unnecessary logics around defining tables
accept table definition in any order in schema