Add lua function 'io.dread' for reading directories.
Change to use static int for script function types, instead of int.