Add support for second level cache

Addresses #295

Tests need to be written.