improved module require by writing to the os tmp dir