Update encodePlanAsJson for Installed package state
The change in how we use the PreExisting vs Installed states means that we'll now have full details for all packages, rather than installed ones having only the subset of info available from the InstalledPackageInfo. So the 'type' field now can take the values "pre-existing", "configured" or "installed". Also do a little bit of tidying up.
Showing with 26 additions and 13 deletions