Slice keys and values from an object