Pack and cache API refactor

Closes #605