Reorg some stuff
Added caching resolver thread