Add some functions for doing local caching and preamble precompilation.
Removed experimental precompilation and caching for now.