Replace POJO definition of HostInfo with a class that properly manages its own serialisation to JSON.