Keep or remove certain keys from an object.