[refactor] Caches now with a constructor/instance api

Should make it easier to extend later on.