The US tax code is notoriously dysfunctional. Meanwhile, countries from New Zealand to Estonia have devised equitable, effective tax structures.