Implement key / offset access for flatten()