Expose keytype and valuetype to context
Convert keys to ints for binary