Cleaned up some model code. Added tld and record rest endpoints. Fixed util.ToJSON to make it handle empty arrays.