remove old debug code
add very simple cache (still experimental)