Makes 'types' further testable.

By removing a call to 'os.listdir', we can test the 'types' module without
having to stub out a file system.