Instance

Converts from class-based to instance-based. Fixes some problems with key depth.