Make the type computation lazy and add tests for type detectors in data tests.