Fix NPE when saving any JSON file and move theme JSON reading to it's
own seperate instance