No need to check type of each value when processing an object.

The _processKeys function itself does that and will handle each type correctly.
Updated version passes all tests and is much shorter.