[keyserver] Introduce convertObject function
Summary:
Introdices convertObject function that implements the visitor pattern and uses it to implement sanitizeInput. It will used in the later diffs for implementing the id conversion function.
sanitizeInput should still redact passwords where it previously redacted them but it will now redact them in more places, e.g. lists, non-string optionals. Previously added tests succeed, and I have also added tests fot the new cases.
Test Plan: Run yarn jest
Reviewers: kamil, inka, tomek, ashoat
Reviewed By: tomek, ashoat
Subscribers: ashoat, atul
Differential Revision: https://phab.comm.dev/D7488