Use IntOrString for health checks

Also improve testing and split into different files.