Reorg code, cleanup, use large json file format