Add cache to require funtion. Add support for return of the require result.