Add support for `keeping` or `only removing`.

This is done through an optional `options` parameter to the overloaded
`.toJSON` method.