Added JSON and cleaned up. Saves to file now too.