Initial working version
add config.preload, caching hacks