NIF file caching patch

This patch implements a in memory loaded NIF file cache to prevent excessive reloading.